minor cleanups (#1361)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Wed, 30 Oct 2024 13:02:22 +0000 (07:02 -0600)
committerGitHub <noreply@github.com>
Wed, 30 Oct 2024 13:02:22 +0000 (07:02 -0600)
* resolve minor nits

* grammar

filter_vecs.cc
rgbcolors.cc
vecs.cc
xmlgeneric.cc

index 6be8c048f2de4409d1f8fb99264079f2c8133a07..5f7a42a96d366c9609f61bb28252f8981167dcf5 100644 (file)
@@ -61,7 +61,7 @@
 template <typename T>
 Filter* fltfactory()
 {
-  static_assert(std::is_base_of<Filter, T>::value, "T must be derived from Filter");
+  static_assert(std::is_base_of_v<Filter, T>, "T must be derived from Filter");
   return new T();
 }
 
index 564c659d33662d4e090472b611e3377982deb3a4..a7f03dec4b34ccc55442ab50b802efed77519b00 100644 (file)
@@ -19,7 +19,7 @@
 
  */
 
-#include <assert.h>            // for assert
+#include <cassert>             // for assert
 
 #include <QByteArray>          // for QByteArray
 #include <QHash>               // for QHash
diff --git a/vecs.cc b/vecs.cc
index 54d26690bbe67bad540f0533972b02aa28a8dfee..7e34a9f0632f7915a076d60d793ffba8d98bde5b 100644 (file)
--- a/vecs.cc
+++ b/vecs.cc
 #include "googletakeout.h"     // for GoogleTakeoutFormat
 
 
-#define MYNAME "vecs"
-
 template <typename T>
 Format* fmtfactory(const QString& filename)
 {
-  static_assert(std::is_base_of<Format, T>::value, "T must be derived from Format");
+  static_assert(std::is_base_of_v<Format, T>, "T must be derived from Format");
   return new T(filename);
 }
 
@@ -490,7 +488,7 @@ Vecs& Vecs::Instance()
  * that we are not modifying a Qt COW copy.
  * Qt has an undocumented but public member function isDetached().
  * If the list is detached it implies it is not shared, then functions
- * then might detach, like the iterator begin which is implicitly used
+ * that might detach, like the iterator begin which is implicitly used
  * in the range based for loop, won't cause a copy to be created.
  * We can make sure this is true for at least our regression cases
  * with assertions.
@@ -498,8 +496,8 @@ Vecs& Vecs::Instance()
  * so we have to exclude this from the check.
  * The possibility of detachment is also why the type of element
  * on the list must be default constructable. This is why we have
- * to supply a default for any const members of arglist_t.  Without
- * the default the default constructor would be implicitly deleted.
+ * to supply a default for any const members of arglist_t.  Without the
+ * default intializer the default constructor would be implicitly deleted.
  */
 
 void Vecs::init_vec(Format* fmt)
@@ -752,9 +750,9 @@ void Vecs::prepare_format(const fmtinfo_t& fmtdata)
   }
 
   /*
-   * For style based formats let xcsv know the style file.  Otherwise
+   * For style based formats let xcsv know the style file.  Otherwise,
    * make sure xcsv knows no style file is in use. This covers the case
-   * that we are processing xcsv,style= and it was preceeded by an xcsv
+   * that we are processing xcsv,style= and it was preceded by a xcsv
    * format that utilized an internal style file.
    */
   auto* xcsvfmt = dynamic_cast<XcsvFormat*>(fmtdata.fmt);
@@ -806,7 +804,7 @@ QString Vecs::get_option(const QStringList& options, const QString& argname)
   QString rval; // null
 
   for (const auto& option : options) {
-    int split = option.indexOf('=');
+    auto split = option.indexOf('=');
     const QString option_name = option.left(split);
     if (option_name.compare(argname, Qt::CaseInsensitive) == 0) {
       /*
index 792bd0574a90d0db41e170ddc3132269b3b572c5..29c8bf3621ac94384c309bc81c180b307ca31afe 100644 (file)
@@ -84,7 +84,7 @@ XmlGenericReader::xml_common_init(const QString& fname, const char* encoding,
   std::for_each(ignorelist.cbegin(), ignorelist.cend(), [this](const QString& tag)->void {
     xg_shortcut_taglist.insert(tag, xg_shortcut::sc_ignore);
   });
-    
+
   std::for_each(skiplist.cbegin(), skiplist.cend(), [this](const QString& tag)->void {
     xg_shortcut_taglist.insert(tag, xg_shortcut::sc_skip);
   });